/**
*选择故障设备
*@url  对话框的URL
*@IDObj 返回的ID
*@NameObj 返回的名称
*/
function ChoseItem(myURL,IDObj,NameObj)
{
	//alert(myURL);
	var attr = null;
	//根据请求页面调整对话框宽度
	if(myURL == '/isky/businessflow/pub/SelectEquip.jsp'){
		attr = 'dialogWidth:700px; dialogHeight:500px; center:yes';
	}else if(myURL.indexOf('SelEmployee.jsp') != -1){
	  attr = "dialogWidth:500px; dialogHeight:500px; center:yes";
	}else{
	  attr = "dialogWidth:300px; dialogHeight:500px; center:yes";
	}

  var retValue = showModalDialog(AddTimeValue(myURL),0,attr);

  if(retValue == null){
  } else{
    //设置名称以及ID
    IDObj.value = retValue[0];
    NameObj.value = retValue[1];
  }
}
/**
*选择部门
*@IDObj 返回的ID
*@NameObj 返回的名称
*/
function SelectCompany(IDObj,NameObj)
{
  ChoseItem('/isky/usrmgr/dialog/SelCompany.jsp',IDObj,NameObj);
}
/**
*选择下级部门
*@IDObj 返回的ID
*@NameObj 返回的名称
*/
function SelectUpperCompany(IDObj,NameObj)
{
  ChoseItem('/isky/usrmgr/dialog/SelCompany.jsp?upper=true',IDObj,NameObj);
}

/**
*选择员工
*@IDObj 返回的ID
*@NameObj 返回的名称
*/
function SelectEmployee(IDObj,NameObj)
{
  ChoseItem('/isky/usrmgr/dialog/SelEmployee.jsp',IDObj,NameObj);
}
/**
*选择所属部门(或下属)员工
*@IDObj 返回的ID
*@NameObj 返回的名称
*/
function SelectUpperEmployee(IDObj,NameObj)
{
  ChoseItem('/isky/usrmgr/dialog/SelEmployee.jsp?upper=true',IDObj,NameObj);
}
function SelectSite(IDObj,NameObj)
{
  ChoseItem('/isky/usrmgr/dialog/SelSite.jsp',IDObj,NameObj);
}
/**
*控制申告单显示
*/
function DisApplyOrder(obj)
{
  //alert(obj.innerText);
  if(obj.innerText == 6){
    obj.title = '点击展开申告单';
    obj.innerText = 4;
    ApplyOrderDiv.style.display = "none";
  }else{
    obj.title = '点击关闭申告单';
    obj.innerText = 6;
    ApplyOrderDiv.style.display = "";
  }
}
//this is modified by elegantyu－－start
function DisDiv(obj,div,otherdiv)//div是对象，otherdiv是字符串
{
  if(otherdiv.id==null)//不是对象的时候
  otherdiv=document.all(otherdiv);
  //alert(obj.innerText);
  if(obj.innerText == 6){
    obj.title = '点击展开';
    obj.innerText = 4;
    div.style.display = "none";
    if(otherdiv!=null)
    otherdiv.style.display='none'
  }else{
    obj.title = '点击关闭';
    obj.innerText = 6;
    div.style.display = "";
     if(otherdiv!=null)
    otherdiv.style.display='';
  }
}

function DisDivOne(obj,div)
{
  //alert(obj.innerText);
  if(obj.innerText == 6){
    obj.title = '点击展开';
    obj.innerText = 4;
    div.style.display = "none";

  }else{
    obj.title = '点击关闭';
    obj.innerText = 6;
    div.style.display = "";

  }
}

//this is modified by elegantyu－－－－－－－－－end
/**
*控制工单显示
*/
function DisOrder(obj)
{

  if(obj.innerText == 6){
    obj.title = '点击展开工单';
    obj.innerText = 4;
    OrderDiv.style.display = "none";
  }else{
    obj.title = '点击关闭工单';
    obj.innerText = 6;
    OrderDiv.style.display = "";
  }
}


function expand_close(obj,div,otherdiv,objiframe)
{
  if(otherdiv.id==null)//不是对象的时候
  otherdiv=document.all(otherdiv);
  if(objiframe.id==null)//不是对象的时候
  objiframe=document.all(objiframe);
  if(obj.innerText == 6){
    obj.title = '点击展开工单';
    obj.innerText = 4;
    if(div!=null)
    div.style.display='none';
    if(otherdiv!=null)
    otherdiv.style.display='none'
    //if(objiframe!=null)
    //document.all(objiframe.name).style.height = 0;
    fuckshowmaininfo.style.display='';
  }else{
    obj.title = '点击关闭工单';
    obj.innerText = 6;
    if(div!=null)
    div.style.display='';
    if(otherdiv!=null)
    otherdiv.style.display='';
    //if(objiframe!=null&&document.all("iframeheight")!=null)
    //document.all(objiframe.name).style.height = document.all("iframeheight").value;
    fuckshowmaininfo.style.display='none';
  }
}
